package com.uy.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.uy.system.model.entity.SysUser;
import com.uy.system.model.vo.SysUserVo;
import com.uy.system.mapper.SysUserMapper;
import com.uy.system.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户信息表 服务实现类
 * </p>
 *
 * @author ly
 * @since 2024-03-22
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Override
    public List<SysUserVo> getSysUserList() {
        return baseMapper.getSysUserList();
    }

    @Override
    public SysUser findSysUser(String username, String password) {
        LambdaQueryWrapper<SysUser> lqw = new LambdaQueryWrapper<>();
        lqw.eq(SysUser::getUserName, username).eq(SysUser::getPassword, password);
        return baseMapper.selectOne(lqw);
    }
}
